function register_new_user(dom_id)
{
  var register_form = new Ext.form.Form({
        labelAlign: 'right',
        url:"/sucri",
    method: "get",    
        baseParams: {action: "register"},
        labelWidth: 110
  });

  register_form.add(
        new Ext.form.TextField({
            fieldLabel: 'First Name',
            name: 'firstname',
            allowBlank:false
        }),

        new Ext.form.TextField({
            fieldLabel: 'Last Name',
            name: 'lastname',
            allowBlank:false
        }),
        new Ext.form.TextField({
          fieldLabel: 'User Name',
          name: 'username',
            allowBlank:false
        }),
      new Ext.form.TextField({
        fieldLabel: 'Password',
        name: 'password',
        inputType: 'password',
          allowBlank:false
      }),
      new Ext.form.TextField({
        fieldLabel: 'Confirm Password',
        name: 'password_confirm',
        inputType: 'password',
          allowBlank:false
      }),
      new Ext.form.TextField({
          fieldLabel: 'Email',
          name: 'email',
        vtype:'email',
        allowBlank:false
      }),
      new Ext.form.TextField({
          fieldLabel: 'Confirm Email',
          name: 'email_confirm',
        vtype:'email',
        allowBlank:false
      }),

      new Ext.form.DateField({
          fieldLabel: 'Date of Birth',
          name: 'dob'
      }),
      new Ext.form.Checkbox({
            boxLabel:'Do you agree with he terms and conditions?',
            name:'term_check',
            value: false,
            width:'auto'
        })
      );

    register_form.applyIfToFields({ width:200 });

  register_form.addButton(('Login'), function(){
            if (register_form.isValid()) {
                register_form.submit({
                    params:{ },
                    waitMsg:'Registeration In Progress, please wait...',
                    success:function(form, action, o) { window.location.replace("/sucri"); },
                    failure:function(form, action) { Ext.MessageBox.alert("Error",action.result.errorMessage); register_form.reset();
                    }
                });
            }else{
                Ext.MessageBox.alert('Errors', 'Please fix the errors noted.');
            }
        }, register_form);

    register_form.addButton('Cancel');

  var register_dlg = new Ext.BasicDialog("register_form", {
      autoCreate: true,
      width: 400,
      height: 400,
      modal: true,
      closable:true,
      resizable:false,
      draggable:true,
      collapsible:false,
      title:'Register as a New User'
  });

  register_form.render(register_dlg.body);
  register_dlg.on("show", function(){ register_form.items.item(0).focus(); });

  register_dlg.show();
};